package com.example.demo.mapper;

import com.example.demo.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserInfoMapper {
    /**
     * 根据用户名查询用户信息
     */
    @Select("select id, user_name, password, github_url, delete_flag, create_time, update_time " +
            "from user_info where user_name = #{userName} and delete_flag = 0")
    UserInfo selectByName(String userName);

    /**
     * 根据用户 id, 查询用户信息
     */
    @Select("select id, user_name, password, github_url, delete_flag, create_time, update_time " +
            "from user_info where id = #{id} and delete_flag = 0")
    UserInfo selectById(Integer id);
}
